package org.beetl.support;

/**
 * 消息支持类.
 * 
 * @author zhoupan.
 * 
 */
public class Message {

 /**
  * 消息范围.(global,field)
  */
 private String scope;

 /**
  * 消息类型.(success,info,warning,danger,error)
  */
 private String type;
 /**
  * 名称.(消息范围是字段的时候,保存字段的属性名,例如:username).
  */
 private String name;
 /**
  * 编码.(例如:404,500,或者i18n的消息key).
  */
 private String code;

 /**
  * 消息.直接展现的消息文本.
  */
 private String message;

 public String getName() {
  return name;
 }

 public void setName(String name) {
  this.name = name;
 }

 public String getCode() {
  return code;
 }

 public void setCode(String code) {
  this.code = code;
 }

 public String getMessage() {
  return message;
 }

 public void setMessage(String message) {
  this.message = message;
 }

 public String getScope() {
  return scope;
 }

 public void setScope(String scope) {
  this.scope = scope;
 }

 public String getType() {
  return type;
 }

 public void setType(String type) {
  this.type = type;
 }

 public boolean isError() {
  return "error".equalsIgnoreCase(this.getType());
 }
}
